package livesun.justiceeternal.view;

import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.util.AttributeSet;
import android.view.MotionEvent;

public class MyCoordinatorLayout extends CoordinatorLayout {
    private boolean canScroll = true;

    public MyCoordinatorLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }


    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        if(canScroll){
            return super.dispatchTouchEvent(ev);
        }else {
            return true;
        }

    }

    public void canScroll(boolean canScroll){

        this.canScroll = canScroll;
    }
}
